package com.itheima.App;

import com.itheima.Dao.UserDao;
import com.itheima.Service.UserService;
import com.itheima.SpringConfig.StringConfig;
import com.itheima.mapper.Usermapper;
import com.itheima.pojo.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

public class Usertest {
    public static void main(String[] args) {
        ApplicationContext ioc = new AnnotationConfigApplicationContext(StringConfig.class);
        Usermapper bean = ioc.getBean(Usermapper.class);
        List<User> all = bean.findAll();
        for (User user : all) {
            System.out.println(user);
        }
    }
}
